﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Common.Interfaces;

namespace Common.Gui.GuiWinFormsLib
{
    /// <summary>
    /// class handling registered content in addin gui
    /// </summary>
    public static class ContentManager
    {
        static Dictionary<string, Control> registeredPanels = new Dictionary<string, Control>();

        internal static void RegisterContent(string name, Control control)
        {
            if (control == null || registeredPanels.ContainsKey(name))
                return;

            registeredPanels.Add(name, control);
        }

        public static Control GetContent(string name)
        {
            Control ctrl = registeredPanels[name];
            return ctrl;
        }
    }
}
